<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>系统参数</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="-112645679">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "-112645679";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("argument.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建系统参数"
  			,"inport":"导入系统参数"
  			,"update":"修改系统参数"
  			,"detail":"系统参数详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#argumentForm").form({
		"":function(){}
		,"srvArgument.saId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvArgument.saName":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "参数名称不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "参数名称最大长度为32个字符";
		}
		,"srvArgument.saFlag":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "参数标识不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "参数标识最大长度为32个字符";
			if(jQuery.trim(el.value)!=""){
				var protocol = $.getAjax("argument.query.do",{exists:true,saFlag:el.value});
				if(protocol.success && protocol.data.list && protocol.data.list.length>0){
					if(!$("#saId").val() || protocol.data.list[0].key!=$("#saId").val())
						return "参数标识已存在";						
				}
			}
		}
		,"srvArgument.saValue":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "参数值不能为空";
			}
			if(el.value.length>256 && el.value.indexOf("[*]")==-1)
				return "参数值最大长度为256个字符";
		}
		,"srvArgument.saDescribe":function(el){
			if(el.value.length>256 && el.value.indexOf("[*]")==-1)
				return "参数描述最大长度为256个字符";
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvArgument" id="argumentForm" name="argumentForm" target="jsoniframe" action="argument.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写系统参数相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("saId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saId"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saId"))))}}
	{{lz.set("saId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saId}}
	<dl lz:if="{{saId_editable||saId_readonly}}" class="saId hidden " major  ref="saId">
		<dt>编　　号:</dt>
		<dd lz:if="{{saId_editable}}" input="hidden">
			<lz:block lz:if="{{srvArgument$saId}}">
				{{srvArgument$saId}}
			</lz:block>
			<lz:block lz:if="{{!srvArgument$saId}}">
			<input type="hidden" value="{{lz.htm(srvArgument.saId)}}" name="srvArgument.saId" id="saId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saId">{{srvArgument.saId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvArgument.saId$||srvArgument.saId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saId}}
	{{lz.set("saName_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saName"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"saName"))))}}
	{{lz.set("saName_readonly",(edittype=='insert'&&false)||(edittype=='update'&&true)||(edittype=='detail'))}}
	
	{{before$saName}}
	<dl lz:if="{{saName_editable||saName_readonly}}" class="saName  " major  ref="saName">
		<dt>参数名称:</dt>
		<dd lz:if="{{saName_editable}}" input="text">
			<lz:block lz:if="{{srvArgument$saName}}">
				{{srvArgument$saName}}
			</lz:block>
			<lz:block lz:if="{{!srvArgument$saName}}">
		 	<input type="text" class="input narrow"   name="srvArgument.saName" id="saName"  value="{{lz.htm(srvArgument.saName)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入系统参数的参数名称</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saName_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saName">{{srvArgument.saName}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvArgument.saName$||srvArgument.saName)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saName}}
	{{lz.set("saFlag_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saFlag"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"saFlag"))))}}
	{{lz.set("saFlag_readonly",(edittype=='insert'&&false)||(edittype=='update'&&true)||(edittype=='detail'))}}
	
	{{before$saFlag}}
	<dl lz:if="{{saFlag_editable||saFlag_readonly}}" class="saFlag  " major  ref="saFlag">
		<dt>参数标识:</dt>
		<dd lz:if="{{saFlag_editable}}" input="text">
			<lz:block lz:if="{{srvArgument$saFlag}}">
				{{srvArgument$saFlag}}
			</lz:block>
			<lz:block lz:if="{{!srvArgument$saFlag}}">
		 	<input type="text" class="input narrow"  maxlength="32" name="srvArgument.saFlag" id="saFlag"  value="{{lz.htm(srvArgument.saFlag)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入系统参数的参数标识</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saFlag_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="saFlag">{{srvArgument.saFlag}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvArgument.saFlag$||srvArgument.saFlag)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saFlag}}
	{{lz.set("saValue_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saValue"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saValue"))))}}
	{{lz.set("saValue_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saValue}}
	<dl lz:if="{{saValue_editable||saValue_readonly}}" class="saValue   mider" major  ref="saValue">
		<dt>参 数 值:</dt>
		<dd lz:if="{{saValue_editable}}" input="text">
			<lz:block lz:if="{{srvArgument$saValue}}">
				{{srvArgument$saValue}}
			</lz:block>
			<lz:block lz:if="{{!srvArgument$saValue}}">
		 	<input type="text" class="input mide"  maxlength="256" name="srvArgument.saValue" id="saValue"  value="{{lz.htm(srvArgument.saValue)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入系统参数的参数值</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saValue_readonly}}">
		 	<div class="state-input mide">
		 		<textarea class=""  style="display:none;" id="saValue">{{srvArgument.saValue}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvArgument.saValue$||srvArgument.saValue)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saValue}}
	{{lz.set("saDescribe_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"saDescribe"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"saDescribe"))))}}
	{{lz.set("saDescribe_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$saDescribe}}
	<dl lz:if="{{saDescribe_editable||saDescribe_readonly}}" class="saDescribe   wider" major  ref="saDescribe">
		<dt>参数描述:</dt>
		<dd lz:if="{{saDescribe_editable}}" input="textarea">
			<lz:block lz:if="{{srvArgument$saDescribe}}">
				{{srvArgument$saDescribe}}
			</lz:block>
			<lz:block lz:if="{{!srvArgument$saDescribe}}">
		 	<textarea class="input wide"  id="saDescribe" name="srvArgument.saDescribe" rows="5">{{srvArgument.saDescribe}}</textarea>
	 	 </lz:block>
	 	 
	 	 <em>请输入系统参数的参数描述</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{saDescribe_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvArgument.saDescribe$||srvArgument.saDescribe)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$saDescribe}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvArgument.saId}}" name="srvArgument.saId" id="saId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/configurator/argument.edit.html?edittype=update&id={{srvArgument.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteArgument('{{srvArgument.id}}','{{srvArgument.saName}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/configurator/argument.edit.html",document.title,"/admin//images/icons/Doc yellow.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/configurator/argument.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除系统参数
	**/
	function deleteArgument(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除系统参数",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/configurator/argument.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>